<template>
  <div>
    <h3>苹果 10￥元一斤，折扣8折</h3>
    <p>请输入你要购买的斤数: <input type="text" v-model.number="form.count"></p>
    <button @click="all">结账</button>
    <p>总价：{{form.total}} 元  折后价： {{form.total * 0.8}}元  省了：{{form.total - form.total *0.8}}元</p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      form: {
        count: 0,
        total: 0
      }
    }
  },

  created () {

  },

  methods: {
    all () {
      this.form.total = 10 * this.form.count
    }
  }
}
</script>

<style scoped lang='less'>

</style>
